﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;
using XamarinToolKit.Model;

namespace XamarinToolKit
{
    public class ToolKitContext : DbContext
    {
        private readonly string _dataBasePath;

        public ToolKitContext(string dataBasePath)
        {
            this._dataBasePath = dataBasePath;
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlite($"FileName={_dataBasePath}");
        }

        public DbSet<ToolKitMaster> ToolKitMasters { get; set; }

        public DbSet<ToolKitDetail> ToolKitDetails { get; set; }
    }
}
